#include "contact_page_style.h"
#include "ui_contact_page_style.h"
#include "globaldata.h"

ContactPageStyle::ContactPageStyle(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::ContactPageStyle)
{
    ui->setupUi(this);
    this->setWindowTitle("contact_page");
    initContactPageUI();
}

ContactPageStyle::~ContactPageStyle()
{
    delete ui;
}

void ContactPageStyle::initContactPageUI()
{
    ui->m_body->setObjectName("body");
    ui->m_body->setStyleSheet("QWidget#body{background:palette(Window);border:0px;border-radius:8px;}");

    ui->m_pQRCode_1->setStyleSheet("border-image:url(:/data/qcpic.png);border:0px;");

    ui->m_pContactUs->adjustSize();
    ui->m_pContactUs->setText(tr("Contact Us"));
    ui->m_pContactUs->setAlignment(Qt::AlignLeft);
    ui->m_pContactUs->setAlignment(Qt::AlignVCenter);

    ui->m_pKylinTeam_1->setProperty("useIconHighlightEffect", 0x2);
    ui->m_pKylinTeam_1->setProperty("isWindowButton", 0x01);
    ui->m_pKylinTeam_1->setFlat(true);
    ui->m_pKylinTeam_1->setIcon(QIcon::fromTheme("stock-people-symbolic"));
    ui->m_pKylinTeam_1->setAttribute(Qt::WA_TransparentForMouseEvents, true);

    ui->m_pKylinTeam_2->adjustSize();
    ui->m_pKylinTeam_2->setText(tr("Support Team"));
    ui->m_pKylinTeam_2->setAlignment(Qt::AlignLeft);
    ui->m_pKylinTeam_2->setAlignment(Qt::AlignVCenter);

    ui->m_pKylinTeam_3->adjustSize();
    ui->m_pKylinTeam_3->setText("KylinOS Support Team");
    ui->m_pKylinTeam_3->setAlignment(Qt::AlignLeft);
    ui->m_pKylinTeam_3->setAlignment(Qt::AlignVCenter);

    ui->m_pTel_1->setProperty("useIconHighlightEffect", 0x2);
    ui->m_pTel_1->setProperty("isWindowButton", 0x01);
    ui->m_pTel_1->setFlat(true);
    ui->m_pTel_1->setIcon(QIcon::fromTheme("call-stop-symbolic"));
    ui->m_pTel_1->setAttribute(Qt::WA_TransparentForMouseEvents, true);

    ui->m_pTel_2->adjustSize();
    ui->m_pTel_2->setText(tr("Tel"));
    ui->m_pTel_2->setAlignment(Qt::AlignLeft);
    ui->m_pTel_2->setAlignment(Qt::AlignVCenter);

    ui->m_pTel_3->adjustSize();
    ui->m_pTel_3->setText("400-089-1870");
    ui->m_pTel_3->setAlignment(Qt::AlignLeft);
    ui->m_pTel_3->setAlignment(Qt::AlignVCenter);
    ui->m_pTel_3->setTextInteractionFlags(Qt::TextSelectableByMouse);

    ui->m_pMail_1->setProperty("useIconHighlightEffect", 0x2);
    ui->m_pMail_1->setProperty("isWindowButton", 0x01);
    ui->m_pMail_1->setFlat(true);
    ui->m_pMail_1->setIcon(QIcon::fromTheme("mail-read-symbolic"));
    ui->m_pMail_1->setAttribute(Qt::WA_TransparentForMouseEvents, true);

    ui->m_pMail_2->adjustSize();
    ui->m_pMail_2->setText(tr("E-mail"));
    ui->m_pMail_2->setAlignment(Qt::AlignLeft);
    ui->m_pMail_2->setAlignment(Qt::AlignVCenter);

    ui->m_pMail_3->adjustSize();
    ui->m_pMail_3->setText("support@kylinos.cn");
    ui->m_pMail_3->setAlignment(Qt::AlignLeft);
    ui->m_pMail_3->setAlignment(Qt::AlignVCenter);
    ui->m_pMail_3->setTextInteractionFlags(Qt::TextSelectableByMouse);
}
void ContactPageStyle::changeFont(QFont curFont)
{
    ui->m_pContactUs->setFont(curFont);
    ui->m_pQRCode_2->setFont(curFont);
    ui->m_pMail_3->setFont(curFont);
    ui->m_pMail_2->setFont(curFont);
    ui->m_pTel_3->setFont(curFont);
    ui->m_pTel_2->setFont(curFont);
    ui->m_pKylinTeam_3->setFont(curFont);
    ui->m_pKylinTeam_2->setFont(curFont);
}
